package com.data.app.dao.primary;

import com.data.app.pojo.primary.DivisionEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface DivisionBaseDao extends JpaRepository<DivisionEntity, String> {

    @Query(value = "select division_name from org_division where division_code = :code", nativeQuery = true)
    String findDivisionNameBycode(String code);

    @Query(value = "select division_code,division_name from org_division where is_valid='1'", nativeQuery = true)
    List<Object[]> findDivisionNameAndDivisionCode();
}
